package view;


import javax.swing.JFrame;
import javax.swing.SpringLayout;
import javax.swing.JSeparator;
import javax.swing.JTabbedPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.SwingConstants;
import javax.swing.JLabel;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JTextField;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.DefaultComboBoxModel;

public class Gin extends JFrame{
	private JTable table;
	private JTextField textField;
	public Gin() {
		SpringLayout springLayout = new SpringLayout();
		getContentPane().setLayout(springLayout);
		
		JSeparator separator = new JSeparator();
		springLayout.putConstraint(SpringLayout.NORTH, separator, 76, SpringLayout.NORTH, getContentPane());
		springLayout.putConstraint(SpringLayout.WEST, separator, 10, SpringLayout.WEST, getContentPane());
		springLayout.putConstraint(SpringLayout.SOUTH, separator, 78, SpringLayout.NORTH, getContentPane());
		springLayout.putConstraint(SpringLayout.EAST, separator, -10, SpringLayout.EAST, getContentPane());
		getContentPane().add(separator);
		
		JSeparator separator_1 = new JSeparator();
		springLayout.putConstraint(SpringLayout.NORTH, separator_1, -71, SpringLayout.SOUTH, getContentPane());
		springLayout.putConstraint(SpringLayout.WEST, separator_1, 10, SpringLayout.WEST, getContentPane());
		springLayout.putConstraint(SpringLayout.SOUTH, separator_1, -69, SpringLayout.SOUTH, getContentPane());
		springLayout.putConstraint(SpringLayout.EAST, separator_1, -10, SpringLayout.EAST, getContentPane());
		getContentPane().add(separator_1);
		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		springLayout.putConstraint(SpringLayout.NORTH, tabbedPane, 10, SpringLayout.SOUTH, separator);
		springLayout.putConstraint(SpringLayout.WEST, tabbedPane, 20, SpringLayout.WEST, getContentPane());
		springLayout.putConstraint(SpringLayout.SOUTH, tabbedPane, -10, SpringLayout.NORTH, separator_1);
		springLayout.putConstraint(SpringLayout.EAST, tabbedPane, 0, SpringLayout.EAST, separator);
		getContentPane().add(tabbedPane);
		
		JPanel panel = new JPanel();
		tabbedPane.addTab("LIVE PURCHASE ORDER", null, panel, null);
		SpringLayout sl_panel = new SpringLayout();
		panel.setLayout(sl_panel);
		
		JSeparator separator_2 = new JSeparator();
		sl_panel.putConstraint(SpringLayout.NORTH, separator_2, 10, SpringLayout.NORTH, panel);
		sl_panel.putConstraint(SpringLayout.SOUTH, separator_2, -10, SpringLayout.SOUTH, panel);
		sl_panel.putConstraint(SpringLayout.EAST, separator_2, -267, SpringLayout.EAST, panel);
		separator_2.setOrientation(SwingConstants.VERTICAL);
		panel.add(separator_2);
		
		JLabel lblPurchaseOrder = new JLabel("PURCHASE ORDER 1");
		sl_panel.putConstraint(SpringLayout.NORTH, lblPurchaseOrder, 27, SpringLayout.NORTH, panel);
		sl_panel.putConstraint(SpringLayout.WEST, lblPurchaseOrder, 10, SpringLayout.WEST, panel);
		panel.add(lblPurchaseOrder);
		
		JLabel lblPurchaseOrder_1 = new JLabel("PURCHASE ORDER 2");
		sl_panel.putConstraint(SpringLayout.NORTH, lblPurchaseOrder_1, 34, SpringLayout.SOUTH, lblPurchaseOrder);
		sl_panel.putConstraint(SpringLayout.WEST, lblPurchaseOrder_1, 0, SpringLayout.WEST, lblPurchaseOrder);
		panel.add(lblPurchaseOrder_1);
		
		JLabel lblPurchaseOrder_2 = new JLabel("PURCHASE ORDER 3");
		sl_panel.putConstraint(SpringLayout.NORTH, lblPurchaseOrder_2, 37, SpringLayout.SOUTH, lblPurchaseOrder_1);
		sl_panel.putConstraint(SpringLayout.WEST, lblPurchaseOrder_2, 0, SpringLayout.WEST, lblPurchaseOrder);
		panel.add(lblPurchaseOrder_2);
		
		JCheckBox chckbxNewCheckBox = new JCheckBox("");
		sl_panel.putConstraint(SpringLayout.WEST, separator_2, 47, SpringLayout.EAST, chckbxNewCheckBox);
		sl_panel.putConstraint(SpringLayout.NORTH, chckbxNewCheckBox, 0, SpringLayout.NORTH, lblPurchaseOrder);
		panel.add(chckbxNewCheckBox);
		
		JCheckBox chckbxNewCheckBox_1 = new JCheckBox("");
		sl_panel.putConstraint(SpringLayout.EAST, chckbxNewCheckBox, 0, SpringLayout.EAST, chckbxNewCheckBox_1);
		sl_panel.putConstraint(SpringLayout.WEST, chckbxNewCheckBox_1, 18, SpringLayout.EAST, lblPurchaseOrder_1);
		sl_panel.putConstraint(SpringLayout.NORTH, chckbxNewCheckBox_1, 0, SpringLayout.NORTH, lblPurchaseOrder_1);
		panel.add(chckbxNewCheckBox_1);
		
		JCheckBox chckbxNewCheckBox_2 = new JCheckBox("");
		sl_panel.putConstraint(SpringLayout.NORTH, chckbxNewCheckBox_2, 0, SpringLayout.NORTH, lblPurchaseOrder_2);
		sl_panel.putConstraint(SpringLayout.WEST, chckbxNewCheckBox_2, 18, SpringLayout.EAST, lblPurchaseOrder_2);
		panel.add(chckbxNewCheckBox_2);
		
		JPanel panel_1 = new JPanel();
		tabbedPane.addTab("GENERATE PURCHASE ORDER", null, panel_1, null);
		SpringLayout sl_panel_1 = new SpringLayout();
		panel_1.setLayout(sl_panel_1);
		
		JSeparator separator_3 = new JSeparator();
		sl_panel_1.putConstraint(SpringLayout.SOUTH, separator_3, 95, SpringLayout.NORTH, panel_1);
		sl_panel_1.putConstraint(SpringLayout.EAST, separator_3, 454, SpringLayout.WEST, panel_1);
		panel_1.add(separator_3);
		
		JLabel lblGinNodate = new JLabel("GIN NO/DATE");
		sl_panel_1.putConstraint(SpringLayout.WEST, panel_1, 10, SpringLayout.WEST, lblGinNodate);
		sl_panel_1.putConstraint(SpringLayout.NORTH, lblGinNodate, 10, SpringLayout.NORTH, panel_1);
		sl_panel_1.putConstraint(SpringLayout.WEST, lblGinNodate, 10, SpringLayout.WEST, panel_1);
		panel_1.add(lblGinNodate);
		
		JLabel lblClick = new JLabel("CLICK ");
		sl_panel_1.putConstraint(SpringLayout.NORTH, lblClick, 0, SpringLayout.NORTH, lblGinNodate);
		sl_panel_1.putConstraint(SpringLayout.WEST, lblClick, 10, SpringLayout.EAST, lblGinNodate);
		panel_1.add(lblClick);
		
		JLabel lblChNodate = new JLabel("CH. NO/DATE");
		sl_panel_1.putConstraint(SpringLayout.WEST, lblChNodate, 10, SpringLayout.WEST, panel_1);
		sl_panel_1.putConstraint(SpringLayout.NORTH, lblChNodate, 6, SpringLayout.SOUTH, lblGinNodate);
		panel_1.add(lblChNodate);
		
		JLabel lblClick_1 = new JLabel("CLICK");
		sl_panel_1.putConstraint(SpringLayout.NORTH, lblClick_1, 6, SpringLayout.SOUTH, lblClick);
		sl_panel_1.putConstraint(SpringLayout.WEST, lblClick_1, 0, SpringLayout.WEST, lblClick);
		panel_1.add(lblClick_1);
		
		JLabel lblGeNodate = new JLabel("G.E. NO/DATE");
		sl_panel_1.putConstraint(SpringLayout.NORTH, lblGeNodate, 6, SpringLayout.SOUTH, lblChNodate);
		sl_panel_1.putConstraint(SpringLayout.WEST, lblGeNodate, 10, SpringLayout.WEST, panel_1);
		panel_1.add(lblGeNodate);
		
		JLabel lblNewLabel = new JLabel("CLICK");
		sl_panel_1.putConstraint(SpringLayout.WEST, lblNewLabel, 0, SpringLayout.WEST, lblClick);
		panel_1.add(lblNewLabel);
		
		JLabel lblIvnNodate = new JLabel("IVN NO/DATE");
		sl_panel_1.putConstraint(SpringLayout.WEST, lblIvnNodate, 10, SpringLayout.WEST, panel_1);
		sl_panel_1.putConstraint(SpringLayout.NORTH, separator_3, 9, SpringLayout.SOUTH, lblIvnNodate);
		sl_panel_1.putConstraint(SpringLayout.NORTH, lblIvnNodate, 6, SpringLayout.SOUTH, lblGeNodate);
		panel_1.add(lblIvnNodate);
		
		JLabel lblClick_2 = new JLabel("CLICK");
		sl_panel_1.putConstraint(SpringLayout.NORTH, lblClick_2, 69, SpringLayout.NORTH, panel_1);
		sl_panel_1.putConstraint(SpringLayout.SOUTH, lblNewLabel, -6, SpringLayout.NORTH, lblClick_2);
		sl_panel_1.putConstraint(SpringLayout.WEST, lblClick_2, 0, SpringLayout.WEST, lblClick);
		panel_1.add(lblClick_2);
		
		JLabel lblProjectName = new JLabel("PROJECT NAME");
		sl_panel_1.putConstraint(SpringLayout.WEST, lblProjectName, 83, SpringLayout.EAST, lblClick);
		sl_panel_1.putConstraint(SpringLayout.SOUTH, lblProjectName, 0, SpringLayout.SOUTH, lblGinNodate);
		panel_1.add(lblProjectName);
		
		JComboBox comboBox = new JComboBox();
		comboBox.setModel(new DefaultComboBoxModel(new String[] {"SHIRVAL PROJEVT", "AUNDH PROJECT", "TATHWEDE PROJECT"}));
		sl_panel_1.putConstraint(SpringLayout.NORTH, comboBox, 0, SpringLayout.NORTH, lblGinNodate);
		sl_panel_1.putConstraint(SpringLayout.WEST, comboBox, 30, SpringLayout.WEST, lblProjectName);
		panel_1.add(comboBox);
		
		JLabel lblCostCentre = new JLabel("COST CENTRE :");
		sl_panel_1.putConstraint(SpringLayout.NORTH, lblCostCentre, 0, SpringLayout.NORTH, lblGinNodate);
		panel_1.add(lblCostCentre);
		
		JComboBox comboBox_1 = new JComboBox();
		sl_panel_1.putConstraint(SpringLayout.NORTH, comboBox_1, 55, SpringLayout.SOUTH, comboBox);
		sl_panel_1.putConstraint(SpringLayout.SOUTH, comboBox_1, -75, SpringLayout.NORTH, comboBox);
		sl_panel_1.putConstraint(SpringLayout.WEST, comboBox, 0, SpringLayout.WEST, comboBox_1);
		sl_panel_1.putConstraint(SpringLayout.WEST, comboBox_1, 317, SpringLayout.WEST, panel_1);
		sl_panel_1.putConstraint(SpringLayout.EAST, comboBox_1, -218, SpringLayout.EAST, panel_1);
		panel_1.add(comboBox_1);
		
		JLabel lblPoNodate = new JLabel("P.O. NO/DATE");
		sl_panel_1.putConstraint(SpringLayout.NORTH, lblPoNodate, 0, SpringLayout.NORTH, lblIvnNodate);
		sl_panel_1.putConstraint(SpringLayout.WEST, lblPoNodate, 0, SpringLayout.WEST, lblProjectName);
		panel_1.add(lblPoNodate);
		
		JComboBox comboBox_2 = new JComboBox();
		sl_panel_1.putConstraint(SpringLayout.NORTH, comboBox_2, -3, SpringLayout.NORTH, lblIvnNodate);
		sl_panel_1.putConstraint(SpringLayout.WEST, comboBox_2, 0, SpringLayout.WEST, comboBox);
		sl_panel_1.putConstraint(SpringLayout.EAST, comboBox_2, 0, SpringLayout.EAST, comboBox);
		panel_1.add(comboBox_2);
		
		JLabel lblVehicalNo = new JLabel("VEHICAL NO :");
		sl_panel_1.putConstraint(SpringLayout.NORTH, lblVehicalNo, 0, SpringLayout.NORTH, lblIvnNodate);
		sl_panel_1.putConstraint(SpringLayout.WEST, lblVehicalNo, 0, SpringLayout.WEST, lblCostCentre);
		panel_1.add(lblVehicalNo);
		
		JScrollPane scrollPane = new JScrollPane();
		sl_panel_1.putConstraint(SpringLayout.WEST, lblCostCentre, 0, SpringLayout.WEST, scrollPane);
		sl_panel_1.putConstraint(SpringLayout.NORTH, scrollPane, 6, SpringLayout.SOUTH, separator_3);
		sl_panel_1.putConstraint(SpringLayout.WEST, scrollPane, 10, SpringLayout.WEST, separator_3);
		sl_panel_1.putConstraint(SpringLayout.SOUTH, scrollPane, 121, SpringLayout.SOUTH, separator_3);
		sl_panel_1.putConstraint(SpringLayout.EAST, scrollPane, 443, SpringLayout.WEST, panel_1);
		panel_1.add(scrollPane);
		
		table = new JTable();
		table.setModel(new DefaultTableModel(
			new Object[][] {
			},
			new String[] {
				"CODE NO", "ITEM DESCRIPTION", "UNIT", "P.O. QTY", "RECEIVED QTY", "REJECTED QTY"
			}
		) {
			boolean[] columnEditables = new boolean[] {
				false, false, false, false, true, true
			};
			public boolean isCellEditable(int row, int column) {
				return columnEditables[column];
			}
		});
		scrollPane.setViewportView(table);
		
		JComboBox comboBox_3 = new JComboBox();
		sl_panel_1.putConstraint(SpringLayout.NORTH, comboBox_3, 0, SpringLayout.NORTH, lblGinNodate);
		sl_panel_1.putConstraint(SpringLayout.WEST, comboBox_3, 6, SpringLayout.EAST, lblCostCentre);
		sl_panel_1.putConstraint(SpringLayout.EAST, comboBox_3, 113, SpringLayout.EAST, lblCostCentre);
		panel_1.add(comboBox_3);
		
		textField = new JTextField();
		sl_panel_1.putConstraint(SpringLayout.NORTH, textField, 40, SpringLayout.SOUTH, comboBox_3);
		sl_panel_1.putConstraint(SpringLayout.WEST, textField, 0, SpringLayout.WEST, comboBox_3);
		sl_panel_1.putConstraint(SpringLayout.EAST, textField, 0, SpringLayout.EAST, comboBox_3);
		panel_1.add(textField);
		textField.setColumns(10);
	}
}
